<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/15
 * Time: 9:50
 */
namespace app\admin\validate;
use think\Validate;
class Rule extends Validate{
    protected $rule = [
        'name'  => 'unique:auth_rule',
        'title' => 'require|unique:auth_rule',
    ];
    //定义错误信息
    protected $message = [
        'name.unique'    => '已经添加该验证规则了',
        'title.require'  => '权限名称不能为空',
        'title.unique'   => '权限名称已经添加过了'
    ];
    //验证场景
    protected $scene = [
        'ruleAdd'  =>  ['name','title'],
    ];
}